<style lang="less">
@import '../assets/style/ganta-list.less';
</style>

<template>
	<div class="gt_list">
		<van-cell-group>
			<van-cell
                v-for="(item,index) in gantaList"
                :key="index">
				<img 
                    slot="icon"
                    :src="picUrlLeft"
                    class="icon_l"
					@click="clickList(item,-1)"
					/>
				<!-- 右侧图标 无需根据业务判断调用titles插槽 start-->
                <div><slot name="titles"></slot></div>
				<!-- 右侧图标 无需根据业务判断调用titles插槽 end-->

                <!-- 右侧图标 需根据条件判断调用titles1插槽 start-->
                <div v-if="item.status==0" @click="clickList(item,0)">
					<slot name="titles1"></slot>
				</div>
                <!-- 右侧图标 需根据条件判断调用titles1插槽 end-->

				<!-- 左侧图标业务条件判断 start-->
                <span>
                    <em v-if="item.alarm=='have'" class="yin" >隐</em>
                    <em v-if="item.que=='have'?true:false" class="que" >缺</em>
                </span>
				<!-- 左侧图标业务条件判断 end-->

                <template slot="title">
                    <div @click="clickList(item,1)" class="clearfix">
                        <span  class="van-cell-text">{{tit}}{{item.textName}}</span>
                        <span>
                            <van-tag plain :class="item.cname">{{item.statusName}}</van-tag>
                        </span>
						<div class="nums">
							<span class="aaa">{{listTitle[1]}}{{item.gtnum}}</span>
							<span>{{listTitle[2]}}{{item.wxsnum}}</span>
						</div>
                    </div>
				</template>
			</van-cell>
		</van-cell-group>
	</div>
</template>

<script>
import {
  Cell,
  CellGroup,
  Tag
} from 'vant';

export default {
	  name: 'xs_list',
	  components: {
	    [Cell.name]: Cell,
	    [CellGroup.name]: CellGroup,
	    [Tag.name]: Tag
	  },
	  props: {
	    gantaList: Array,
		picUrlLeft: String,
		picUrlRight: String,
        tit: String,
		iconText: String,
		listTitle:{
            type: Array,
            default () {
                return []
            }
		},
	  },
	  data() {
	    return {
          cname: 'iconRight'
	    }
	  },
	  methods: {
	    clickList(data,num){
            let param = {}
            param.todo = num
            param.data = data 
	        this.$emit('clickList',param)
	    }
	  }
}
</script>